STOP Statement ---------------------------------------------------------------------------- Action Terminates the program. Syntax STOP n% Remarks The STOP statement halts a program and returns the value n% to the operating system. The value n% can be used by DOS or OS-2 batch files or by non-BASIC programs. If n% is omitted, the STOP statement returns a value of 0. Untrapped errors and fatal errors set the value of n% to -1. You can place a STOP statement anywhere in a program to terminate execution. In a stand-alone program, STOP closes all files and returns to the operating system; in the QBX environment, STOP leaves files open and returns to that environment. If you use the -D, -E, or -X compiler option on the BC command line, the STOP statement prints line numbers as follows. ----------------------------------------------------------------------------- If your program has. STOP prints. ---------------------------------------------------------------------------- Line numbers Number of the line where execution stopped. No line number for STOP Most recent line number. No line numbers 0 In the QBX environment, STOP always returns an error level of 0, even if you specify a different error level. In some previous versions of BASIC, STOP statements were used for debugging. In the current version of BASIC, you do not have to use STOP for debugging. See Also END, SYSTEM Example See the ON ERROR statement programming example, which uses the STOP statement.